From: Florian Müllner Date: Wed, 1 Apr 2020 19:04:03 +0000 (+0200) Subject: extensionSystem: Add method for opening extension prefs X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~548 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=45bc850715f875aca705ddccc39b9cc46e757bd1;p=gnome-shell.git extensionSystem: Add method for opening extension prefs Extension that want to expose their own preferences (for example as menu items) do that by passing their UUID to gnome-shell-extension-prefs. But since 3.36.1 the app is optional and no longer accepts arguments on the command line. To adjust, extensions now need to make a D-Bus call the extensions portal, just like the app and gnome-shell. We will add a convenience method for that purpose, so it makes sense to share the existing code. As it's extension-related, the extension manager looks like the right place ... https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1163 --- diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 4fab0c334..4cce0c52d 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -215,6 +215,24 @@ var ExtensionManager = class { return true; } + openExtensionPrefs(uuid, parentWindow, options) { + const extension = this.lookup(uuid); + if (!extension || !extension.hasPrefs) + return false; + + Gio.DBus.session.call( + 'org.gnome.Shell.Extensions', + '/org/gnome/Shell/Extensions', + 'org.gnome.Shell.Extensions', + 'OpenExtensionPrefs', + new GLib.Variant('(ssa{sv})', [uuid, parentWindow, options]), + null, + Gio.DBusCallFlags.NONE, + -1, + null); + return true; + } + notifyExtensionUpdate(uuid) { let extension = this.lookup(uuid); if (!extension) diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index c413df291..75a2f341d 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -316,16 +316,7 @@ var GnomeShellExtensions = class { } OpenExtensionPrefs(uuid, parentWindow, options) { - Gio.DBus.session.call( - 'org.gnome.Shell.Extensions', - '/org/gnome/Shell/Extensions', - 'org.gnome.Shell.Extensions', - 'OpenExtensionPrefs', - new GLib.Variant('(ssa{sv})', [uuid, parentWindow, options]), - null, - Gio.DBusCallFlags.NONE, - -1, - null); + Main.extensionManager.openExtensionPrefs(uuid, parentWindow, options); } ReloadExtensionAsync(params, invocation) {